#include "precompile.h"

#include "SplineItemPresentation.h"

#include "document/ISplineItem.h"
#include "document/Types.h"

SplineItemPresentation::SplineItemPresentation()
{
}

SplineItemPresentation::~SplineItemPresentation()
{

}

void SplineItemPresentation::Present(Graphics* graphics,PresentationContext& context)
{
	sys::InterfacePtr<ISplineItem> pIFSplineItem(context.GetTarget());

	Pen pen(Color::Blue) ;
	switch (pIFSplineItem->GetCategory())
	{
	case lineSplineItemRegion:
		{
			Line line = pIFSplineItem->SLine();
			graphics->DrawLine(pen,line.begin,line.end);
			break;
		}
	case rectangleSplineItemRegion:
		{
			graphics->DrawRectangle(pen,pIFSplineItem->Rectangle());
			break;
		}
	}

}